Ticket #43: Fixed bug by adding checks within model