Finally fixed create function