a simple question how to drop a database with the use of IF stmt to check if the object exist.

if object_id('dbo.myDB') is not null
drop database 'myDB'
go

the code returns no error but it also wont delete the database("myDB")