implemented poll handeling