updated to be Qt5 compatible