added delay and now it works