better implementation of fix