Calendar popup not working correctly?