Fix double instance creation bug