fixed last challenge logic