added else to main function