fixed create function in pins controller