Fixed error. Now inserting in database