What is wrong here? Everything seems to work according to requirements. Please help. Thanks in advance.