fixing bug with aps