improve buttons behaviour