Added if-query to catch the empty password problem