Added conditionals to create and update actions in contact controller